<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  nav ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
  }
  
  nav li {
    display: inline-block;
    width: 80px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    position: relative;
    background-color: #fff;
  }
  
  nav li:hover {
    background-color: #f7f7f7;
  }
  
  .submenu {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 200px;
    background-color: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  }
  
  .submenu li {
    display: inline-block;
    width: 80px;
    height: 90px;
    text-align: center;
    line-height: 90px;
    border-right: 1px solid #d9d9d9;
    margin: 30px 80px;
  }
  
  .submenu li:last-child {
    border-right: none;
  }
  
  .submenu img {
    vertical-align: middle;
    width: 150px;
    height: 150px;
  }
</style>
<body>
  <nav>
    <ul>
      <li><a href="#">首页</a></li>
      <li><a href="#">小米手机</a></li>
      <li><a href="#">红米手机</a></li>
      <li><a href="#">电视</a></li>
      <li><a href="#">笔记本</a></li>
    </ul>
    <div class="submenu">
      <ul>
        <li><img src="http://m.qpic.cn/psc?/V50fSXGE3acZo9042DiZ0pdYfF2ZgsD1/bqQfVz5yrrGYSXMvKr.cqV0K39TVXNbwzrTB5XJCmuqd1*BgjVCGvV8*oOPKsQQQMAxcq61l4kXu.iIjHe0fEOaDo0RXuQC11OdOvgxokgA!/b&bo=tAC0AAAAAAADByI!&rf=viewer_4"></li>
        <li><img src="http://m.qpic.cn/psc?/V50fSXGE3acZo9042DiZ0pdYfF2ZgsD1/bqQfVz5yrrGYSXMvKr.cqV0K39TVXNbwzrTB5XJCmuqd1*BgjVCGvV8*oOPKsQQQMAxcq61l4kXu.iIjHe0fEOaDo0RXuQC11OdOvgxokgA!/b&bo=tAC0AAAAAAADByI!&rf=viewer_4"></li>
        <li><img src="http://m.qpic.cn/psc?/V50fSXGE3acZo9042DiZ0pdYfF2ZgsD1/bqQfVz5yrrGYSXMvKr.cqV0K39TVXNbwzrTB5XJCmuqd1*BgjVCGvV8*oOPKsQQQMAxcq61l4kXu.iIjHe0fEOaDo0RXuQC11OdOvgxokgA!/b&bo=tAC0AAAAAAADByI!&rf=viewer_4"></li>
        <li><img src="http://m.qpic.cn/psc?/V50fSXGE3acZo9042DiZ0pdYfF2ZgsD1/bqQfVz5yrrGYSXMvKr.cqV0K39TVXNbwzrTB5XJCmuqd1*BgjVCGvV8*oOPKsQQQMAxcq61l4kXu.iIjHe0fEOaDo0RXuQC11OdOvgxokgA!/b&bo=tAC0AAAAAAADByI!&rf=viewer_4"></li>
        <li><img src="http://m.qpic.cn/psc?/V50fSXGE3acZo9042DiZ0pdYfF2ZgsD1/bqQfVz5yrrGYSXMvKr.cqV0K39TVXNbwzrTB5XJCmuqd1*BgjVCGvV8*oOPKsQQQMAxcq61l4kXu.iIjHe0fEOaDo0RXuQC11OdOvgxokgA!/b&bo=tAC0AAAAAAADByI!&rf=viewer_4"></li>
        
      </ul>
    </div>
  </nav>

  <script>
  // 获取菜单项和内容栏
var menuItems = document.querySelectorAll('nav ul li');
var submenu = document.querySelector('.submenu');

// 遍历菜单项并为其添加鼠标移入/移出事件
for (var i = 1; i < menuItems.length; i++) {
  menuItems[i].addEventListener('mouseenter', showSubmenu);
  menuItems[i].addEventListener('mouseleave', hideSubmenu);
}

// 显示内容栏
function showSubmenu() {
  submenu.style.display = 'block';
}

// 隐藏内容栏
function hideSubmenu() {
  submenu.style.display = 'none';
}
  </script>
</body>
</html>